import axios from './request'
/*************************user用户*************************/
//用户注册
export function userRegister(params){
    return axios.post("/lr/register",params)
}
//用户登录
export function userLogin(params){
    return axios.post("/lr/login",params)
}
//微信登录
export function wxLogin(params){
    return axios.post("/lr/wxlogin",params)
}
/*微信绑定*/
export function wxBind(params){
    return axios.post("/lr/bind",params)
}
/*绑定邮箱*/
export function emailBind(params){
    return axios.post("/users/emailBind",params)
}
/*获得邮箱验证码*/
export function emailCode(params){
    return axios.post("/lr/emailCode",params)
}
/*验证邮箱验证码*/
export function setEmailCode(params){
    return axios.post("/lr/setEmailCode",params)
}
/*忘记密码*/
export function Forget(params){
    return axios.post("/lr/Forget",params)
}

//Header组件获取当前用户名字
export function getHeader(params){
    return axios.get("/users/header",params)
}
//获得所有用户
export function getUserAll(params){
    return axios.get("/users/all",params)
}
//获取单个用户
export function getUserSingle(params){
    return axios.get("/users/single",params)
}
//修改用户信息
export function setUserInfo(params){
    return axios.post("/users/edit",params)
}
//重置用户密码
export function setUserResetPwd(params){
    return axios.post("/users/password",params)
}
//删除用户信息
export function delUserInfo(params){
    return axios.post("/users/del",params)
}
//修改用户余额
export function setUserBalance(params){
    return axios.post("/users/editBalance",params)
}
//获取用户余额
export function getUserBalance(params){
    return axios.post("/users/balance",params)
}
//用户修改名字
export function setUserName(params){
    return axios.post("/users/setName",params)
}
//用户修改联系方式
export function setUserTel(params){
    return axios.post("/users/setTel",params)
}
//用户修改登录密码
export function setUserPwd(params){
    return axios.post("/users/changPeassword",params)
}
//获得所有用户的注册时间
export function getUserRegisterTime(params){
    return axios.get("/users/zcsj",params)
}
//获得所有用户的登录时间
export function getUserLoginTime(params){
    return axios.get("/users/drsj",params)
}
//获得用户每日奖励信息
export function getUserDailySurplus(params){
    return axios.get("/users/mrjl",params)
}
//用户头像上传
export function setUserAvatar(params){
    return axios.post("/users/avatar",params)
}
//用户获得余额账单
export function getUserBill(params){
    return axios.post("/users/billing",params)
}
//获得用户的登录记录
export function getUserLog(params){
    return axios.get("/users/log",params)
}

/*************************server服务器*************************/
//获得所有未删除的服务器
export function getServer(params){
    return axios.get("/server",params)
}
//添加服务器信息
export function addServer(params){
    return axios.post("/server/add",params)
}
//修改服务器信息
export function setServer(params){
    return axios.post("/server/edit",params)
}
//服务器进入回收站
export function outServer(params){
    return axios.post("/server/out",params)
}
//删除服务器
export function delServer(params){
    return axios.post("/server/del",params)
}
//获取所有回收站中的服务器
export function getServerRecycle(params){
    return axios.get("/server/recycle",params)
}
//回收站恢复服务器
export function setServerRecovery(params){
    return axios.post("/server/recovery",params)
}
//用户所有租赁订单
export function getServerLease(params){
    return axios.get("/server/lease",params)
}
//用户所有未完成租赁订单
export function getServerLeaseUnfinish(params){
    return axios.get("/server/leaseUnfinish",params)
}
//获得所有用户当前拥有的服务器数量
export function getUserLeaseCount(params){
    return axios.get("/server/userLeaseCount",params)
}
//添加新的租赁
export function addServerLease(params){
    return axios.post("/server/leaseAdd",params)
}
//修改租赁
export function setServerLease(params){
    return axios.post("/server/leaseEdit",params)
}
//结算租赁
export function finishServerLease(params){
    return axios.post("/server/leaseFinish",params)
}
//删除租赁
export function delServerLease(params){
    return axios.post("/server/leaseDel",params)
}
//获得已结算的租赁订单
export function getServerLeaseFinish(params){
    return axios.get("/server/leaseFinish",params)
}

/*************************order订单*************************/
//获得所有用户订单
export function getOrder(params){
    return axios.get("/order",params)
}
//搜索指定订单
export function searchOrder(params){
    return axios.get("/order/search",params)
}
//创建进群订单
export function addOrder(params){
    return axios.post("/order/add",params)
}
//修改订单的状态
export function setOrder(params){
    return axios.post("/order/edit",params)
}
//获得用户的订单消息
export function getOrderInfo(params){
    return axios.get("/order/info",params)
}
//用户订单续费
export function setOrderXufei(params){
    return axios.post("/order/xufei",params)
}
/*获得套餐信息*/
export function getTaocan(params){
    return axios.get("/order/getxbqTC",params)
}
//获得订单图标信息
export function getOrderEcharts(params){
    return axios.get("/order/echarts",params)
}
//获得指定时间内的订单信息
export function getOrderTime(params){
    return axios.get("/order/time",params)
}
/*************************article文章*************************/
//用户发布文章
export function addArticle(params){
    return axios.post("/article/add",params)
}
//用户修改文章
export function editArticle(params){
    return axios.post("/article/edit",params)
}
//用户删除文章
export function delArticle(params){
    return axios.post("/article/del",params)
}
//获得所有文章
export function getArticles(params){
    return axios.get("/article",params)
}
//获得文章详细内容
export function getArticle(params){
    return axios.get("/article/single",params)
}
//发布文章上传图片
export function addImgArticle(params){
    return axios.post("/article/imgAdd",params)
}
//发布文章删除图片
export function delImgArticle(params){
    return axios.post("/article/imgDel",params)
}
//文章浏览，点赞
export function recordArticle(params){
    return axios.post("/article/record",params)
}
//添加评论
export function addCommentArticle(params){
    return axios.post("/article/addComment",params)
}
//获得评论
export function getCommentArticle(params){
    return axios.get("/article/getComment",params)
}
//获得二级评论
export function getTwoCommentArticle(params){
    return axios.get("/article/getTwoComments",params)
}
//添加评论回复
export function addCommentHFArticle(params){
    return axios.post("/article/addCommentHF",params)
}
//获得用户发布的文章
export function getuserArticle(params){
    return axios.get("/article/getUserArticle",params)
}
//获得用户发布的文章数量
export function getuserArticleCount(params){
    return axios.get("/article/getUserArticleCount",params)
}
//搜索文章
export function getLikeArticle(params){
    return axios.post("/article/getLikeArticle",params)
}
//搜索自己的文章
export function getLikeMyArticle(params){
    return axios.post("/article/getLikeMyArticle",params)
}
//修改文章的权限
export function setOvert(params){
    return axios.post("/article/setOvert",params)
}

/*每日有奖*/
export const addSurplus = (params) => {
    return axios.post("/surplus",params)
}

/*发送报错日志*/
export const addErrorLog = (params) => {
    return axios.post("/err",params)
}
/*获取报错日志*/
export const getErrorLog = (params) => {
    return axios.get("/err/all",params)
}
/*评论点赞*/
export const loveComment = (params) => {
    return axios.post("/article/loveComment",params)
}
/*取消评论点赞*/
export const delLoveComment = (params) => {
    return axios.post("/article/delLoveComment",params)
}

export const WxJsSdk = (params) => {
    return axios.post("/sdk",params)
}
/*用户绑定微信*/
export const userWxBind = (params) => {
    return axios.post("/users/wxbind",params)
}
/*订单备注*/
export const orderRemarks = (params) => {
    return axios.post("/order/remarks",params)
}
/*创建微信支付订单*/
export const getWxPay = (params) => {
    return axios.post("/pay",params)
}
/*微信支付订单心跳查询*/
export const getWxPayState = (params) => {
    return axios.post("/pay/res",params)
}
/*主动查询订单状态*/
export const getWxPayRes = (params) => {
    return axios.post("/pay/gewxtres",params)
}
/*获得单个订单号的付款地址*/
export const getWxPayUrl = (params) => {
    return axios.post("/pay/address",params)
}
/*获得充值历史记录*/
export const getWxPayHistory = (params) => {
    return axios.get("/pay/history",params)
}
